<template>
  <div>
    <h2>这是父组件</h2>
    <p>本案例演示把子组件的数据放入到父组件中</p>
    <hr />

    <!-- 子组件标签注册了原生事件，触发要加修饰符 -->
    <Page @click="fn" ref="demo" />
  </div>
</template>

<script>
import Page from '../components/Page.vue'

export default {
  methods: {
    fn() {
      console.log('hello !')
    }
  },
  mounted() {
    console.log(this.$refs.demo)
  },
  components: {
    Page
  }
}
</script>

<style lang="less" scoped></style>
